/**
 * $Id$
 * Copyright(C) 2015-2020 yingu - internet center, All Rights Reserved.
 */
package com.treasure.service.result;

import com.github.pagehelper.Page;

import java.io.Serializable;

/**
 * 分页显示的结果
 * @author <a href="mailto:lzm8285@163.com">panxinwen</a>
 * @version 1.0 2015年12月08日 17:44:00
 */
public class PageResult<T> implements Serializable{

	private static final long serialVersionUID = 9014763784496485161L;
	/** 总页数 */
	private int totalPages;
	/** 总记录数 */
	private int total;
	/** 分页数据 */
	private T rows;


	public PageResult(){}

	public PageResult(Page page,T t) {
		this.totalPages = page.getPages();
		this.total = Integer.valueOf(String.valueOf(page.getTotal()));
		this.rows = t;
	}

	public int getTotalPages() {
		return totalPages;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public T getRows() {
		return rows;
	}

	public void setRows(T rows) {
		this.rows = rows;
	}
}
